/**
 * CopyRight © 2012 USTC SINOVATE SOFTWARE CO.LTD All Rights Reserved.
 */

package com.cmcc.zysoft.spring.security.service;

import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import com.cmcc.zysoft.infocollection.constant.Constant;
import com.cmcc.zysoft.infocollection.model.Resource;
import com.starit.common.dao.hibernate.HibernateBaseDao;
import com.starit.common.dao.service.BaseServiceImpl;

/**
 * @author 袁凤建
 * <br />邮箱: yuan.fengjian@ustcinfo.com
 * <br />描述: ExportExcelService.java
 * <br />版本: 1.0.0
 * <br />日期: 2013-9-29 下午2:55:34
 * <br />CopyRight © 2012 USTC SINOVATE SOFTWARE CO.LTD All Rights Reserved.
 */

@Service
public class ExportExcelService extends BaseServiceImpl<Resource, String> {

	@Autowired
	private JdbcTemplate jdbcTemplate;
	
	@Override
	public HibernateBaseDao<Resource, String> getHibernateBaseDao() {
		return null;
	}
	
	public List<Map<String, Object>> getExportData() {
		String sql = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest()
				.getSession().getAttribute(Constant.EXPORT_EXCEL_SQL).toString();
		return this.jdbcTemplate.queryForList(sql);
	}
}